%option noyywrap
%{
	#include <map>
	#include <set>
	#include <string>
	using namespace std;
	int word_count = 0, unique_word_count = 0;
	set<string> table;
%}
%%
[^ \t\n]+	{word_count ++; table.insert(yytext);}
%%
int main() {
	yylex();
	unique_word_count = table.size();
	printf("there are %d words, in which %d are unique\n", word_count, unique_word_count);
	return 0;
}
